package org.example.service.impl;

import org.example.dao.MyDao;
import org.example.dao.OrderDao;
import org.example.dao.impl.MyDaoImpl;
import org.example.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;

public class MyServiceImpl implements MyService {
    //private MyDao myDao = new MyDaoImpl();
    private MyDao myDao;

    private OrderDao orderDao;
    private String stuName;
    private int num;

    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public void getMyDaoInfo() {
        myDao.get();
        System.out.println("MyService"+", name = "+stuName+num);
    }

    // 配置文件使用set方法进行依赖注入
    public void setMyDao(MyDao myDao){
        this.myDao=myDao;
    }
}
